#ifndef __Render_RenderManager_h__
#define __Render_RenderManager_h__

#include <vector>
#include <map>

namespace Orca {

	class IGfxDriver;
	class TRenderQueue;
	class IRenderQueueSorter;

	//--------------------------------------------------------------------------
	class TRenderManager {

	public:
		TRenderManager(IGfxDriver *gfxDriver);
		~TRenderManager();

		void render(unsigned short startQueueId, unsigned short stopQueueId);

		void registerRenderQueue(unsigned short id, IRenderQueueSorter *sorter);
		void unregisterRenderQueue(unsigned short id);
		TRenderQueue* getRenderQueue(unsigned short id);

	private:
		IGfxDriver *mGfxDriver;

		typedef std::map<unsigned short, TRenderQueue*> TRQMapping;
		typedef std::vector<TRenderQueue*> TRQList;

		TRQMapping mRQMapping;
		TRQList mRQList;

		void _refreshRQList();

	};
}

#endif	// __Render_RenderManager_h__